<script type="text/javascript">
var SliderSetValue = function(event, ui) 
{	
	var value = $( this ).slider( "option", "value" );
	$( this ).children( "a" ).html( value );
	$( this ).parent( ).children( "input" ).attr( "value", value );
};
$(function() 
{	
	$(".slider").slider( 
	{		
		slide: SliderSetValue,		
		change: SliderSetValue	
	} );	
	$("#friendly").slider({ value: <?php print $this->Rating ? $this->Rating->friendly : 50 ?> });	
	$("#accurate").slider({ value: <?php print $this->Rating ? $this->Rating->accurate : 50 ?> });	
	$("#helpful").slider({ value: <?php print $this->Rating ? $this->Rating->helpful : 50 ?> });	
	$("#creative").slider({ value: <?php print $this->Rating ? $this->Rating->creative : 50 ?> });	
	$("#trustworthy").slider({ value: <?php print $this->Rating ? $this->Rating->trustworthy : 50 ?> });	
	$("#critical").slider({ value: <?php print $this->Rating ? $this->Rating->critical : 50 ?> });	
	$("#gooder").slider({ value: <?php print $this->Rating ? $this->Rating->gooder : 50 ?> });		
	$("textarea[name='comment']").focus(function() 
	{		
		$(this).html( "" );	
	} );
} );
</script>
<div style="margin-left: 20px; margin-right: 20px; margin-bottom: 20px;">
<form method="post" action=""><input type="hidden" name="form"
	value="rating" /> <input type="hidden" name="rated"
	value="<?php echo $this->Rated; ?>" />
<h1 style="text-align: center;"><?php text('Rate')?> <?php echo $this->RatedName; ?></h1>
<div style="text-align: center; margin-top: 50px;">
<p style="float: left;">0%</p>
<p style="float: right;">100%</p>
<h3><?php text('Friendly')?></h3>
</div>
<div>
<div class="slider" id="friendly"></div>
<input type="hidden" name="friendly" /></div>
<div style="text-align: center; margin-top: 50px;">
<p style="float: left;">0%</p>
<p style="float: right;">100%</p>
<h3><?php text('Accurate')?></h3>
</div>
<div>
<div class="slider" id="accurate"></div>
<input type="hidden" name="accurate" /></div>
<div style="text-align: center; margin-top: 50px;">
<p style="float: left;">0%</p>
<p style="float: right;">100%</p>
<h3><?php text('Helpful')?></h3>
</div>
<div>
<div class="slider" id="helpful"></div>
<input type="hidden" name="helpful" /></div>
<div style="text-align: center; margin-top: 50px;">
<p style="float: left;">0%</p>
<p style="float: right;">100%</p>
<h3><?php text('Creative')?></h3>
</div>
<div>
<div class="slider" id="creative"></div>
<input type="hidden" name="creative" /></div>
<div style="text-align: center; margin-top: 50px;">
<p style="float: left;">0%</p>
<p style="float: right;">100%</p>
<h3><?php text('Trustworthy')?></h3>
</div>
<div>
<div class="slider" id="trustworthy"></div>
<input type="hidden" name="trustworthy" /></div>
<div style="text-align: center; margin-top: 50px;">
<p style="float: left;">0%</p>
<p style="float: right;">100%</p>
<h3><?php text('Critical')?></h3>
</div>
<div>
<div class="slider" id="critical"></div>
<input type="hidden" name="critical" /></div>
<div style="text-align: center; margin-top: 50px;">
<p style="float: left;">0%</p>
<p style="float: right;">100%</p>
<h3><?php text('Gooder')?></h3>
</div>
<div>
<div class="slider" id="gooder"></div>
<input type="hidden" name="gooder" /></div>
<div style="text-align: center; margin-top: 50px;">
<h3><?php text('Comment')?></h3>
<textarea name="comment" style="width: 100%; height: 80px;"><?php print $this->Rating ? $this->Rating->comment : text('Add a comment to your rating') ?></textarea>
</div>
<div style="text-align: center; margin-top: 50px;"><input type="submit"
	value="<?php text('Rate') ?> <?php echo $this->RatedName ?>" /></div>
</form>
</div>
